package com.example.demo2.service.impl;

import com.example.demo2.dao.Student;
import com.example.demo2.mapper.StudentMapper;
import com.example.demo2.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentMapper studentMapper;

    //增
    @Override
    public int insertStudent(Student student) {
        return studentMapper.insert(student);
    }
    //删
    @Override
    public int deleteStudent(int id) {
        return studentMapper.delete(id);
    }
    //改
    @Override
    public int updateStudent(Student student) {
        return studentMapper.update(student);
    }
    //查
    @Override
    public List<Student> findAllStudent() {
        return studentMapper.selectAllStudent();
    }
}
